//
//  ZLookSearchView.m
//  DoctorFAQs
//
//  Created by zjq on 17/2/20.
//  Copyright © 2017年 zjq. All rights reserved.
//

#import "ZLookSearchView.h"

@implementation ZLookSearchView
- (instancetype)init
{
    self = [super init];
    if (self) {
        [self initlizeInterface];
    }
    return self;
}
- (void)initlizeInterface {
    _backgroundView = [[UIView alloc] init];
    _searchImageView = [[UIImageView alloc] init];
    _searchImageView.image = [UIImage imageNamed:@"btn_search"];
    _searchLabel = [[UILabel alloc] init];
    _searchLabel.textAlignment = NSTextAlignmentLeft;
    _searchLabel.textColor = KHGaryColor;
    _searchLabel.text = @"搜索关键字";
    _searchBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [_searchBtn setBackgroundColor:[UIColor clearColor]];
    [self addSubview:_backgroundView];
    [self addSubview:_searchImageView];
    [self addSubview:_searchLabel];
    [self addSubview:_searchBtn];
    [_searchBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self).offset(10*xsIZE);
        make.height.offset(30*ysIZE);
        make.right.equalTo(self).offset(-10*xsIZE);
        make.top.equalTo(self).offset(10*ysIZE);
    }];
    [_searchImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.height.width.offset(15*xsIZE);
        make.centerY.equalTo(_searchBtn);
        make.left.equalTo(_searchBtn);
    }];
    [_searchLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_searchImageView.mas_right).offset(5*xsIZE);
        make.width.equalTo(_searchBtn).multipliedBy(0.6);
        make.centerY.height.equalTo(_searchBtn);
    }];
    [_backgroundView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.height.width.equalTo(_searchBtn);
    }];
}
@end
